package com.quxiu.system.controller;

import com.quxiu.common.core.domain.R;
import com.quxiu.common.core.web.controller.BaseController;
import com.quxiu.common.security.annotation.InnerAuth;
import com.quxiu.system.service.*;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * id生成服务
 *
 * @author quxiu
 */
@RestController
@RequestMapping("/id")
public class IdController extends BaseController {
    @Resource
    private IdService idService;

    /**
     * 获取下一个id
     */
    @InnerAuth
    @GetMapping("/nextId")
    public R<Long> nextId() {
        return R.ok(idService.nextId());
    }
}
